package fy.hr.controller;

	import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.servlet.ModelAndView;





import com.seeyon.ctp.common.AppContext;
import com.seeyon.ctp.common.controller.BaseController;

import fy.hr.dao.FindPersonInfoDao3;
import fy.hr.dao.RecruitmentPersonInfoDao;
import fy.hr.dao.WorkOverTimeFormDao;

	public class OA2HRControllertest extends BaseController {
		/*private static Log log = LogFactory.getLog(OA2HRControllertest.class);

		private final static String recruitmentPersonInfoByIDnumJSP = "fy_view/oa2hr/Recruitment/recruitmentPersonInfo";

		public ModelAndView getFindPersonInfoJSP(HttpServletRequest request,
				HttpServletResponse response) throws Exception {
			ModelAndView modelAndView = null;

			if (AppContext.getCurrentUser() != null) {
				modelAndView = new ModelAndView(recruitmentPersonInfoByIDnumJSP);
			}
			return modelAndView;
		}
			
		public ModelAndView idnumFindPersonInfo(HttpServletRequest request,
					HttpServletResponse response) throws Exception {
				ModelAndView modelAndView = new ModelAndView();
				try {

					boolean success = false;

					String  idnums = request.getParameter("idnums");
					System.out.println("!!!!!!!!!"+idnums);
					response.setCharacterEncoding("utf-8");
					if (AppContext.getCurrentUser() != null && idnums != null
							&& !"".equals(idnums)) {
				
						//idnums = idnums.replaceAll(".*([';]+|(--)+).*", " ");
						if (!"".equals(idnums)) {
							String[] idnumsArray = idnums.split(",");
							if (idnumsArray != null &&idnumsArray.length != 0) {
								RecruitmentPersonInfoDao rpd=new RecruitmentPersonInfoDao();
								rpd.setIdnums(idnums);
						modelAndView.addObject("personInfoJSON",rpd
						.idnumfindPersonInfo(idnums).toString());
								success = true;
							}
						}
					}
					if (!success) {
						modelAndView.addObject("personInfoJSON", "{}");
					}

				} catch (Exception e) {
					e.printStackTrace();
				}
				return modelAndView;
			}*/
		private static Log log = LogFactory.getLog(OA2HRControllertest.class);

		private final static String workOverTimePersonInfoByIDnumJSP = "fy_view/oa2hr/workOvertime/workOverTimePersonInfo.jsp";

		public ModelAndView getFindPersonInfoByCodeJSP(HttpServletRequest request,
				HttpServletResponse response) throws Exception {
			ModelAndView modelAndView = null;
			if (AppContext.getCurrentUser() != null) {
				modelAndView = new ModelAndView(workOverTimePersonInfoByIDnumJSP);
			}
			return modelAndView;
		}
			
//		public ModelAndView jobNumFindPersonInfo(HttpServletRequest request,
//					HttpServletResponse response) throws Exception {
//				ModelAndView modelAndView = new ModelAndView();
//				try {
//
//					boolean success = false;
//
//					String jobNums = request.getParameter("jobNums");
//					System.out.println("!!!!!!!!!"+jobNums);
//					response.setCharacterEncoding("utf-8");
//					if (AppContext.getCurrentUser() != null && jobNums != null
//							&& !"".equals(jobNums)) {
//						if (!"".equals(jobNums)) {
//							String[] jobNumsArray = jobNums.split(",");
//							if (jobNumsArray != null &&jobNumsArray.length != 0) {
//							WorkOverTimeFormDao wot=new WorkOverTimeFormDao();
//							wot.setIdnums(jobNums);
//						modelAndView.addObject("personInfoJSON",wot
//						.idnumfindPersonInfo(jobNums).toString());
//								success = true;
//							}
//						}
//					}
//					if (!success) {
//						modelAndView.addObject("personInfoJSON", "{}");
//					}
//				} catch (Exception e) {
//					e.printStackTrace();
//				}
//				return modelAndView;
//			}
		}

	



